package com.hq.ims.data.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hq.ims.data.annotation.CompareField;
import com.hq.ims.data.vo.CompanyAptitudeMapstruct;
import com.hq.mybatis.base.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.ibatis.type.Alias;

import java.io.Serializable;
import java.time.LocalDate;

/**
* @author 蒋柏平
* @since 20241022
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Alias("CompanyAptitude")
@TableName(value = "company_aptitude")
@ApiModel(value = "企业资质", description = "企业资质")
public class CompanyAptitude extends BaseModel<CompanyAptitude> implements Serializable {

    @ApiModelProperty(value = "企业资质ID")
    @TableId(value = "company_aptitude_id",type = IdType.ASSIGN_UUID)
    private String companyAptitudeId;

    @ApiModelProperty(value = "主键")
    @TableField(value = "company_id")
    private String companyId;

    @ApiModelProperty(value = "企业资质证书名称")
    @TableField(value = "company_aptitude_name")
    private String companyAptitudeName;

    @ApiModelProperty(value = "等级")
    @TableField(value = "lv")
    private String lv;

    @ApiModelProperty(value = "有效结束时间")
    @TableField(value = "valid_end_date")
    @JSONField(format = "yyyy-MM-dd")
    private LocalDate validEndDate;

    public CompanyAptitudeMapstruct.CompanyAptitudeRowAuthVo auth(){
        CompanyAptitudeMapstruct.CompanyAptitudeRowAuthVo auth = new CompanyAptitudeMapstruct.CompanyAptitudeRowAuthVo(this);
        return auth;
    }

}
